package utils

import (
	"fmt"
	"net"
	"time"
)

func Telnet(addr string, timeout int16) bool {
	//net.DialTimeout("tcp", addr, time.Duration(timeout)*time.Second)
	conn, err := net.DialTimeout("tcp", addr, time.Duration(timeout)*time.Second)

	if err != nil {
		fmt.Println("telnet error=", err, "addr=", addr)
		return false
	}
	conn.Close()
	return true
}
